﻿using Sunny.UI;
using System.Drawing;

namespace CoreShop.App
{
    public partial class UIReturnItem1 : UIUserControl
    {
        public UIReturnItem1()
        {
            InitializeComponent();
        }

        private Color selectedColor = Color.FromArgb(255, 192, 128);
        public Color SelectedColor
        {
            get => selectedColor;
            set
            {
                selectedColor = value;
                Invalidate();
            }
        }

        public string DishName
        {
            get => uiLabel3.Text;
            set => uiLabel3.Text = value;
        }

        public string Number
        {
            get => lblNumber.Text;
            set => lblNumber.Text = value;
        }
        public string SpecName
        {
            get => lblSpecName.Text;
            set => lblSpecName.Text = value;
        }
        public string UnitName
        {
            get => lblUnitName.Text;
            set => lblUnitName.Text = value;
        }
        public string Price
        {
            get => lblPrice.Text;
            set => lblPrice.Text = value;
        }
        public bool SelectFlag
        {
            get => chbSelectFlag.Checked;
            set
            {
                chbSelectFlag.Checked = value;
                Invalidate();
            }
        }

        public string Money
        {
            get => uiLabel4.Text;
            set => uiLabel4.Text = value;
        }

        private void UIReturnItem1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            if (SelectFlag)
            {
                //Color SelectedColor = Color.FromArgb(255, 192, 128);
                e.Graphics.FillRectangle(SelectedColor, 0, 0, Width, Height);
            }
        }

        private void chbSelectFlag_Click(object sender, System.EventArgs e)
        {
            SelectFlag = chbSelectFlag.Checked;
        }
    }
}
